package HLLibClasses;

import HLCode.HLClassManager;
import HLCode.HLLibClass;
import HLCode.HLObject;
import HLLib.base.HLByteList;

public class HLClassByteList extends HLLibClass {
    public HLClassByteList(HLClassManager owner) {
        super(owner);
    }

    public HLObject NewObject() {
        return new HLByteList();
    }

    public void Execute(HLObject self, int index, HLObject args, HLObject resultOwnerObject, int resultIndex) {
        switch (index) {
        case 0: {
            ((HLByteList) self).SetCount(args.GetInt(0));
            break;
        }
        case 1: {
            ((HLByteList) self).Add(args.GetInt(0));
            break;
        }
        case 2: {
            ((HLByteList) self).AddRange((HLByteList)args.GetObject(0));
            break;
        }
        case 3: {
            ((HLByteList) self).Clear();
            break;
        }
        case 4: {
            if (resultOwnerObject == null) {
                ((HLByteList) self).Count();
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLByteList) self).Count());
            }
            break;
        }
        case 5: {
            if (resultOwnerObject == null) {
                ((HLByteList) self).GetItem(args.GetInt(0));
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLByteList) self).GetItem(args.GetInt(0)));
            }
            break;
        }
        case 6: {
            ((HLByteList) self).SetItem(args.GetInt(0), args.GetInt(1));
            break;
        }
        case 7: {
            ((HLByteList) self).Insert(args.GetInt(0), args.GetInt(1));
            break;
        }
        case 8: {
            ((HLByteList) self).InsertRange(args.GetInt(0), (HLByteList)args.GetObject(0));
            break;
        }
        case 9: {
            ((HLByteList) self).CopyAll(args.GetInt(0), (HLByteList)args.GetObject(0));
            break;
        }
        case 10: {
            ((HLByteList) self).Copy(args.GetInt(0), (HLByteList)args.GetObject(0), args.GetInt(1), args.GetInt(2));
            break;
        }
        case 11: {
            ((HLByteList) self).RemoveAt(args.GetInt(0));
            break;
        }
        case 12: {
            ((HLByteList) self).Resize(args.GetInt(0), args.GetInt(1));
            break;
        }
        }
    }
}
